﻿@using TjZheng.Power.DataEntity;
@inherits CMSWebViewPage<IconInfo>
@{
    ViewBag.Title = "图标编辑";
    Layout = "~/Views/Shared/_EditLayout.cshtml";
}

<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center',border:false">
        <div class="top-block">
            @CurrentButtonTool.Create()
        </div>
        <form id="fr_iconinfo" method="post" enctype="multipart/form-data">
            @*@Html.AntiForgeryToken()*@
            <table class="tblContent">
                <colgroup>
                    <col class="colTitle">
                    <col class="colContent" />
                </colgroup>
                <tr>
                    <td><span class="txtNoNull">*</span>名称:</td>
                    <td>
                        @Html.Hidden("objProvide.Id", Model.Id, false)
                        @Html.StringBox("objProvide.Name", Model.Name, true, "请输入名称", null, ValidType.Length(64))
                    </td>
                </tr>
                <tr>
                    <td><span class="txtNoNull">*</span>图标:</td>
                    <td>
                        @Html.StringBox("objProvide.Icon", Model.Icon, true, "请输入图标", new { onchange = "PreviewIcon(this)" }, null, ValidType.Length(64))
                        预览图：<a id="icon_preview" class="easyui-linkbutton" data-options="iconCls:'@Model.Icon',plain:true"></a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
@section Bottom{
    <script type="text/javascript">
        function Save() {
            var objFormEntity = new FormEntity("#fr_iconinfo");
            objFormEntity.url = "/iconinfo/save/";
            objFormEntity.submitSuccess = function (InvokeResult) {
                if (InvokeResult.ResultCode == "Success") {
                    ShowMessage(InvokeResult.ResultMessage);
                    Back();
                } else {
                    ShowMessage(InvokeResult.ResultMessage);
                }
            };
            objFormEntity.isClearData = false;
            objFormEntity.submit();
        }
        function Back() {
            window.location.href = "/iconinfo";
        }
        function PreviewIcon(source) {
            var icon = $(source).val();
            $("#icon_preview").linkbutton({ iconCls: icon });
        }
    </script>
}